package com.apes.enquiry.enquiry.repository;

import com.apes.enquiry.enquiry.model.FirstBrand;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 类描述：
 *
 * @ClassName FirstBrandRepository
 * @Description 描述
 * @Author wushilong
 * @Date 2023/3/20 17:38
 * @Version 1.0
 */
public interface FirstBrandRepository extends CustomRepository<FirstBrand, String> {

    @Query(value = "select a.BrandId from FirstBrand a where a.partyRoleId = :supplier and a.BrandId is not null")
    List<String> findAllBySupplier(String supplier);

    @Query(value = "select a from FirstBrand a where a.BrandId = :brand and a.partyRoleId = :supplier")
    List<FirstBrand> findBrandAndSupplier(String brand, String supplier);
}
